package com.hncj.yqfk.ldao;

import com.hncj.yqfk.entity.USER;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;


/**
 * username 登录用户名
 * password 登录密码
 * **/

public interface USER_Dao extends JpaRepository<USER,Integer> {

    @Query(value = "select * from exam_ticket  where username=? and password=?",nativeQuery = true)
    List<USER> findUserByUsernameAndPassword(String username , String password);

    @Query(value ="insert into user (username,password) values(?1,?2)",nativeQuery = true)
    boolean Add(String username,String password);

    @Query(value = "select * from user  where username=?",nativeQuery = true)
    List<USER> findByUsername(String username);

}
